﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Web;

namespace nanoCMS.Core.Membership
{
    public static class AvatarProvider
    {
        
        public static bool AvatarExists(int userId)
        {
            string dir = HttpContext.Current.Server.MapPath(Settings.AvatarUploadPath);
            string path = Path.Combine(dir, GenerateAvatarName(userId));
            return File.Exists(path); 
        }

        //pulic MvcHtmlString Get(this HtmlHelper htmlHelper, int userId)
        public static string GenerateAvatarName(int userId)
        {
            return userId + ".avatar.png"; 
        }
    }
}
